<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>let</title>
</head>
<body>
    <script>
        //let 声明变量  变量声明符号
        let a;
        let b=100;
        let c,d,e;
        let f=200, g=300, h;  


        //let 声明特点
        //1. 不允许重复声明
        let star = '罗志祥';
        // let star = '小猪';
        // console.log(star);

        //2. 块儿级作用域  块儿 if(){}   else if(){}  else{}   while{}  for(){}   {}
        if(1){
            let girlfriend = '周扬青';
            console.log(girlfriend)
        }
        {
            let type = '老板';
            console.log(type);
        }
        
        //3. 变量提升   存在变量提升, 名词: 临时性死区
        // console.log(song);
        // let song = '狐狸精';

        //4. 不影响作用域链
        function main(){
            let dance = '精武门';
            function test(){
                console.log(dance);
            }
            test();
        }

        main();
        
    </script>
</body>
</html>